home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
MONITOR
/
SWEARS10.ARJ
/
SWEARS.DOC
< prev
next >
Wrap
Text File
|
1991-06-25
|
13KB
|
164 lines
Help!
Here's the first release beta version of my "swears" curses-look-alike lib
for the pc environment. BUT I need help. This package is far from complete,
so why don't you try it with your Quick C compiler, and e-mail me some
suggestions...
Thanks!
Jim Dunn, dunn@andrews.edu
/**************************************************************************\
* Swears *
* by Professor Von Ignatius Pseudo, E.K.C.P. *
* *
* Swears is a C add-on library giving you various windowing and utility *
* functions provided in unix curses. There's no termcap, but there IS *
* direct video screen writes with TRUE refresh functions! Use at your *
* own risk... *
* *
* This implementation of Swears is for the Microsoft Quick C language on *
* the IBM PC compatibles, based on the unix curses package. You'll need *
* the two files: SWEARS.H and SWEARS.LIB (renamed from SWEARS_x.LIB) and *
* these two files may be renamed to CURSES.H and CURSES.LIB if you like. *
* As usual, if you are having any problems, you might try a vacation... *
* *
* Swears is TOTALLY, COMPLETELY, ENTIRELY free! You may use the Swears *
* library to create any program, either free or for sale, without paying *
* any royalty fees. You don't even have to display any sort of Swears *
* logo, copyright or info about Swears in your program, at all. Swears *
* is IdeaRighted (I) 1990 by ACME F.S.P.F. Please see attached document. *
* *
* Yes, this was another TEAM ATTACK project... *
* "I tried to get the team to work on it, but they attacked me !?!" *
* -Professor Von Ignatius Pseudo, E.K.C.P. *
\***************************************************************************/
┌──────────────────────────────────────────────────────────────────────────┐
│ │
│ NAME │
│ │
│ swears - screen functions to emulate the unix curses library. │
│ │
│ SYNTAX │
│ │
│ #include <swears.h> │
│ │
│ This will automatically include the stdio.h header file. │
│ │
│ DESCRIPTION │
│ │
│ This version of curses for the pc is based upon a direct │
│ screen write algorithm. No termcap is used, just arrays and │
│ video memory writes. The original screen is saved, an image │
│ of the screen is built in memory and that memory is written │
│ to the screen each time the REFRESH() function is called. │
│ The INITSCR() function MUST be used before any other of the │
│ functions, and you MUST end with ENDWIN() before exiting. │
│ │
│ FUNCTIONS │
│ │
│ addch(ch) add a character to stdscr │
│ addstr(str) add a string to stdscr │
│ │
│ box(win,vert,hor) draw a box around a window │
│ │
│ cbreak() set cbreak mode │
│ clear() clear stdscr │
│ clearok(scr,boolf) set clear flag for scr │
│ clrtobot() clear to bottom on stdscr │
│ clrtoeol() clear to end of line on stdscr │
│ │
│ delch() delete a character │
│ deleteln() delete a line │
│ delwin(win) delete win │
│ │
│ echo() set echo mode │
│ endwin() end window modes │
│ erase() erase stdscr │
│ │
│ flushok(win,boolf) set flush-on-refresh flag for win │
│ │
│ getch() get a char through stdscr │
│ getcap(name) get terminal capability name │
│ getstr(str) get a string through stdscr │
│ gettmode() get tty modes │
│ getyx(win,y,x) get (y,x) co-ordinates │
│ │
│ inch() get char at current (y,x) co-ordinates │
│ initscr() initialize screens │
│ insch(c) insert a char │
│ insertln() insert a line │
│ │
│ leaveok(win,boolf) set leave flag for win │
│ longname(termbuf,name) get long name from termbuf │
│ │
│ move(y,x) move to (y,x) on stdscr │
│ mvcur(lasty,lastx,newy,newx) │
│ actually move cursor │
│ newwin(lines,cols,begin_y,begin_x) │
│ create a new window │
│ nl() set newline mapping │
│ nocbreak() unset cbreak mode │
│ noecho() unset echo mode │
│ nonl() unset newline mapping │
│ noraw() unset raw mode │
│ │
│ overlay(win1,win2) overlay win1 on win2 │
│ overwrite(win1,win2) overwrite win1 on top of win2 │
│ │
│ printw(fmt,arg1,arg2,...) │
│ printf on stdscr │
│ │
│ raw() set raw mode │
│ refresh() make current screen look like stdscr │
│ resetty() reset tty flags to stored value │
│ │
│ savetty() stored current tty flags │
│ scanw(fmt,arg1,arg2,...) scanf through stdscr │
│ scroll(win) scroll win one line │
│ scrollok(win,boolf) set scroll flag │
│ setterm(name) set term variables for name │
│ standend() end standout mode │
│ standout() start standout mode │
│ subwin(win,lines,cols,begin_y,begin_x) │
│ create a subwindow │
│ │
│ touchline(win,y,sx,ex) mark line y sx through ex as changed │
│ touchoverlap(win1,win2) mark overlap of win1 and win2 as changed │
│ touchwin(win) change all of win │
│ │
│ unctrl(ch) printable version of ch │
│ │
│ waddch(win,ch) add char to win │
│ waddstr(win,str) add string to win │
│ wclear(win) clear win │
│ wclrtobot(win) clear to bottom of win │
│ wclrtoeol(win) clear to end of line on win │
│ wdelch(win,c) delete char from win │
│ wdeleteln(win) delete line from win │
│ werase(win) erase win │
│ wgetch(win) get a char through win │
│ wgetstr(win,str) get a string through win │
│ winch(win) get char at current (y,x) in win │
│ winsch(win,c) insert char into win │
│ │
│ winsertln(win) insert line into win │
│ wmove(win,y,x) set current (y,x) co-ordinates on win │
│ wprintw(win,fmt,arg1,arg2,...) │
│ printf on win │
│ wrefresh(win) make screen look like win │
│ wscanw(win,fmt,arg1,arg2,...) │
│ scanf through win │
│ wstandend(win) end standout mode on win │
│ wstandout(win) start standout mode on win │
│ │
│ EXAMPLE │
│ │
│ The following example shows how to compile a swears program. │
│ │
│ qcl <files.c> SWEARS.LIB │
│ cl <files.c> SWEARS.LIB │
│ │
│ EOF │
│ by Jim Dunn, dunn@andrews.edu │
└──────────────────────────────────────────────────────────────────────────┘